package com.gitee.wsl.common.chart.animation

import android.view.animation.DecelerateInterpolator
import android.view.animation.Interpolator
import com.gitee.wsl.common.ui.api.InvalidateAble

abstract class AbstractChartAnimation<T> {

    var duration: Long = DEFAULT_DURATION
    var interpolator: Interpolator = DecelerateInterpolator()

    abstract fun animateFrom(
        startPosition: Float,
        entries: List<T>,
        callback: com.gitee.wsl.common.ui.api.InvalidateAble
    ): AbstractChartAnimation<T>

    companion object {
        private const val DEFAULT_DURATION = 1000L
    }
}